package com.starwish.starwishblog.mapper;

import com.starwish.starwishblog.entity.Comment;
import com.starwish.starwishblog.vo.CommentVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface CommentMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(CommentVo commentVo);

    Comment selectByPrimaryKey(Integer id);

    List<Comment> selectAll();

    int updateByPrimaryKey(CommentVo commentVo);

    List<CommentVo> selectChildCommentBycCons(@Param("content") String content,@Param("username") String uname,@Param("title") String title,@Param("rootId") Integer rootId);

    List<CommentVo> selectRootCommentByCons(@Param("content") String content,@Param("username") String uname,@Param("title") String title);

    int deleteById(@Param("id") Integer id,@Param("status") Integer status);

    List<CommentVo> selectByArticleIdIsParent(@Param("aid") Integer aid);

    List<CommentVo> selectByParentId(@Param("pid") Integer id);

    int insertComment(CommentVo commentVo);

}